<template>
  <div class="orderFail_wrap">
    <headTop :headClass="'white_header'">
      Order details
    </headTop>
    <div class="scroll_wrap">
       <div class="total_box">
        <div class="to_left">
          <h4>{{amount}}</h4>
          <span>Hang up amount ( CNY )</span>
        </div>
        <div class="to_right">
          <div class="img_box">
            <img :src="img" alt="Head portrait">
          </div>
          <span>{{nick}}</span>
        </div>
      </div>
      <div class="info">
        <div class="info_top">
          <div class="top_left">
            <span class="iconfont icon-ziliao"></span>
            <span class="txt">Buyer information</span>
          </div>
        </div>
        <div class="info_content">
          <div class="content_left">
            <p>
              <span class="title">Real name:</span>
              <span class="content">{{name}}</span>
            </p>
            <p>
              <span class="title">Turnover:</span>
              <span class="content">{{num}} CNY</span>
            </p>
          </div>
          <div class="content_right">
            <p>
              <span class="title">Contact:</span>
              <span class="content">{{phone}}</span>
            </p>
            <p>
              <span class="title">Honesty value:</span>
              <span class="content level_num">{{level}}</span>
            </p>
          </div>
        </div>
      </div>
      <ul class="pay_info">
        <li class="copy">
          <span>Order number</span>
          <div class="number">
            <span>{{link}}</span>
          </div>
        </li>
        <li>
          <span class="pay_left">Transaction mode</span>
          <span class="pay_right">{{way}}</span>
        </li>
      </ul>
      <div class="btn_wrap">
        <div class="btn">Transaction failure</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'orderFail',
  data () {
    return {
      id: this.$route.query.id || 0,
      value: Number(this.$route.query.value) || 0,
      amount: '',
      nick: '',
      img: '',
      name: '',
      num: '',
      phone: '',
      level: '',
      link: '',
      way: ''
    };
  },
  methods: {
    // Detail interface
    getDetail () {
      this.axios.post('index/transa/sell_xiangqing', {
        ids: this.id
      }).then(({data}) => {
        if (data.status === 200) {
          this.amount = data.data.point;
          this.nick = data.data.username;
          this.img = data.data.buy_avatar;
          this.name = data.data.buy_username;
          this.phone = data.data.mobile;
          this.level = data.data.praise;
          this.link = data.data.address;
          this.num = data.data.completion_point;
          if (data.data.coin_type === 1) {
            this.way = 'Alipay';
          } else if (data.data.coin_type === 2) {
            this.way = 'WeChat';
          } else {
            this.way = data.data.zhi.bank_name;
          }
        } else {
          this.Toast(data.message);
        }
      });
    }
  },
  mounted () {
    this.getDetail();
  }
};
</script>

<style lang="scss" scoped>
  @import '../style/public.scss';
  .orderFail_wrap{
    height: 100%;
    padding-top: 90px;
    background: #f4f5f7;
    .scroll_wrap {
      height: 100%;
      overflow-y: scroll;
      .total_box {
        height: 203px;
        background: url('./../image/pic2_02.png') no-repeat;
        background-size: cover;
        padding: 0 45px;
        color: #fff;
        margin-bottom: 20px;
        display: flex;
        justify-content: space-between;
        .to_left {
          text-align: left;
        }
        .to_right {
          text-align: center;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          padding: 42px 0;
          span {
            color: #222222;
          }
          .img_box {
            width: 100%;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            img {
              width: 70px;
              height: 70px;
              display: block;
              border-radius: 50%;
              border: 2px solid #fff;
            }
          }
        }
        h4 {
          font-size: 48px;
          padding-top: 52px;
          font-weight: 500;
        }
        span {
          font-size: 24px;
          padding-left: 5px;
        }
      }
      .info {
        background: #fff;
        .info_top {
          display: flex;
          justify-content: space-between;
          align-items: center;
          height: 87px;
          border-bottom: 1Px solid #e6e6e6;
          padding-left: 30px;
          .iconfont {
            padding-right: 10px;
            color: #5c7af3;
          }
          .txt {
            font-size: 26px;
            color: #666666;
          }
        }
        .info_content {
          height: 190px;
          padding: 0 30px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          p {
            line-height: 65px;
            .title {
              font-size: 26px;
              color: #999999;
            }
          .content {
              font-size: 26px;
              color: #222222;
              &.level_num {
                font-size: 28px;
              }
            }
          }
        }
      }
      .comfire_txt {
        height: 110px;
        line-height: 110px;
        font-size: 28px;
        color: #666666;
        text-align: center;
      }
      .pay_info {
        margin-top: 20px;
        padding: 0 30px;
        background: #fff;
        li {
          height: 106px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          border-bottom: 1Px solid #e5e5e5;
          &:last-child {
            border-bottom: none;
          }
          .pay_left {
            font-size: 28px;
            color: #282828;
          }
          .pay_right {
            font-size: 28px;
            color: #282828;
          }
        }
        .copy {
          height: 106px;
          line-height: 106px;
          font-size: 28px;
          color: #282828;
          display: flex;
          justify-content: space-between;
          align-items: center;
          border-bottom: 1Px solid #e5e5e5;
          .number {
            display: flex;
            justify-content: flex-start;
            align-items: center;
          }
        }
      }
      .btn_wrap {
        text-align: center;
        padding: 0 74px;
        margin-top: 60px;
        margin-bottom: 90px;
        .public_btn {
          box-shadow: 0px 0px 10px 10px #f6ebd2;
          margin-bottom: 36px;
          width: 100%;
        }
        .btn {
          width: 100%;
          height: 84px;
          line-height: 84px;
          font-size: 30px;
          color: #999999;
          border: 1Px solid #c7c7c8;
          border-radius: 40px;
        }
      }
    }
  }
</style>
